/*
 *  author: lichuang
 *  2010-09-27
 */

#include "common/array.h"
#include "common/common.h"
#include "stack.h"

int main(int argc, char *argv[]) {
  int size;
  if (argc > 1) {
    size = atoi(argv[1]);
  } else {
    size = DEFAULT_ARRAY_SIZE;
  }
  stack_t *stack;
  stack = stack_create(size);
  stack_init(stack);
  stack_print(stack, NULL);

  stack_push(stack, 10);
  printf("after push 10:\n");
  stack_print(stack, NULL);

  int value = stack_pop(stack);
  printf("after pop %d:\n", value);
  stack_print(stack, NULL);

  stack_destroy(stack);
  return 0;
}
